if ( $createRedirect ) {
$contentHandler = ContentHandler::getForTitle( $this );
- $redirectContent = $contentHandler->makeRedirectContent( $nt );
+ $redirectContent = $contentHandler->makeRedirectContent( $nt,
+ wfMessage( 'move-redirect-text' )->inContentLanguage()->plain() );
// NOTE: If this page's content model does not support redirects, $redirectContent will be null.
} else {
* @since 1.21
*
* @param Title $destination the page to redirect to.
+ * @param string $text text to include in the redirect, if possible.
*
* @return Content
*/
- public function makeRedirectContent( Title $destination ) {
+ public function makeRedirectContent( Title $destination, $text = '' ) {
return null;
}
* @see ContentHandler::makeRedirectContent
*
* @param Title $destination the page to redirect to.
+ * @param string $text text to include in the redirect, if possible.
*
* @return Content
*/
- public function makeRedirectContent( Title $destination ) {
+ public function makeRedirectContent( Title $destination, $text = '' ) {
$optionalColon = '';
if ( $destination->getNamespace() == NS_CATEGORY ) {
$mwRedir = MagicWord::get( 'redirect' );
$redirectText = $mwRedir->getSynonym( 0 ) . ' [[' . $optionalColon . $destination->getFullText() . ']]';
+ if ( $text != '' ) {
+ $redirectText .= "\n" . $text;
+ }
return new WikitextContent( $redirectText );
}
'movesubpagetext' => 'This page has $1 {{PLURAL:$1|subpage|subpages}} shown below.',
'movenosubpage' => 'This page has no subpages.',
'movereason' => 'Reason:',
+'move-redirect-text' => '', # do not translate or duplicate this message to other languages
'revertmove' => 'revert',
'delete_and_move' => 'Delete and move',
'delete_and_move_text' => '== Deletion required ==
'redirect-text',
'edithelppage',
'autocomment-prefix',
+ 'move-redirect-text',
);
/** Optional messages, which may be translated only if changed in the target language. */
'movesubpagetext',
'movenosubpage',
'movereason',
+ 'move-redirect-text',
'revertmove',
'delete_and_move',
'delete_and_move_text',